#[macro_use]
use std::fmt;
use serde::Deserialize;
use serde_json::{Result, Value};

#[derive(Deserialize, Debug)]
struct BotPara {
    id: String,
    typ: i32,
    wxid: String,
    roomid: String,
    content: String,
    nickname: String,
    ext: String,
}

#[derive(Deserialize, Debug)]
struct JsonPara {
    arris_para: BotPara,
}
pub struct JsonUtil {}

impl JsonPara {
    pub fn print_struct<T: fmt::Debug>(foo: T) {
        println!("{:?}", foo);
    }
}

impl JsonUtil {
    pub fn show(para: &String) {
        /*let u:JsonPara = match serde_json::from_str(&para){
          Ok(s)=>JsonPara::print_struct(s),
          Err(e)=>println!("error")
        };
        let u: JsonPara = serde_json::from_str(&para).unwrap();
        JsonPara::print_struct(u);
        println!("{}", u.arris_para.id);*/
        /*{
           Ok(s)=>println!("{}", s.arrisPara.wxid),
           Err(..)=>println!("error"),
        };*/
    }
}
